package com.dailyblue.java.cloud.nacos.feign.controller;

import com.dailyblue.java.cloud.nacos.feign.feign.ProviderFeign;
import com.dailyblue.java.commons.util.JsonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/feign")
public class FeignController {
    @Resource
    private ProviderFeign providerFeign;

    @GetMapping("/a")
    public JsonResult a() {
        return providerFeign.a();
    }

    @GetMapping("/b/{a}")
    public JsonResult b(@PathVariable("a") int a) {
        return providerFeign.b(a);
    }

    @GetMapping("/c/{a}/{b}")
    public JsonResult c(@PathVariable("a") int a, @PathVariable("b") String b) {
        return providerFeign.c(a, b);
    }
}
